/* 卡牌模块  */
import http from './index'

// 获取卡牌列表(分页)
export function getCardListApi ({ orderNo, pageNo, pageSize, userId, userWmsId }) {
  return http.post('/card/all', { orderNo, pageNo, pageSize, userId, userWmsId })
}

// 卡牌回寄
export function cardReturnApi ({ cardIds, logisticsCompany, orderNo, trackingNo, sendPerson, sendAddress, sendPhone	}) {
  return http.post('/card/batchUpdateReturn', { cardIds, logisticsCompany, orderNo, trackingNo, sendPerson, sendAddress, sendPhone	})
}

// 修改卡牌信息
export function setCardInfoApi ({ addCount, cardId, cardStatus, id, orderNo, rating, ratingNo, score, userId, userWmsId }) {
  return http.post('/card/updateCardInfo', { addCount, cardId, cardStatus, id, orderNo, rating, ratingNo, score, userId, userWmsId })
}

// 根据单号获取卡牌
export function queryCardApi ({ orderNo, pageNo, pageSize }) {
  return http.post('/card/queryByOrderNo', { orderNo, pageNo, pageSize })
}

// 卡牌入库
export function cardStockApi ({ cardIds, orderNo }) {
  return http.post('/card/batchUpdateStock', { cardIds, orderNo })
}

// 批量新增卡牌
export function batchAddCardApi ({orderNo, actualCount}) {
  return http.post('/card/batchAddCardByOrderNo', { orderNo, actualCount })
}

// 查询订单初审状态
export function queryIsAllAuditApi (orderNo) {
  return http.post('/inOrder/queryReviewStatus', { orderNo })
}

// 查询卡牌信息
export function queryCardInfoApi ({ cardId, ratingNo }) {
  return http.post('/card/queryCardByCondition', { cardId, ratingNo })
}

// 查询卡牌回寄信息
export function queryCardReturnApi (cardId) {
  return http.post('/card/queryReturnByCardId', { cardId })
}

// 卡牌初审提交
export function cardFirstReviewApi ({ cardId, firstReason, firstReview }) {
  return http.post('/card/updateFirstReview', { cardId, firstReason, firstReview })
}

// 批量新增卡牌:退货入库
export function batchAddReturnCardApi ({ cardList, trackingNo, orderNo }) {
  return http.post('/card/batchAddReturnCardByOrderNo', { cardList, trackingNo, orderNo })
}
